package com.luhuiguo.cms.shared.event;

import com.google.gwt.event.shared.GwtEvent;
import com.luhuiguo.cms.shared.model.ArticleModel;

public class EditArticleEvent extends GwtEvent<EditArticleEventHandler> {
    public static Type<EditArticleEventHandler> TYPE = new Type<EditArticleEventHandler>();

    private final ArticleModel article;

    public EditArticleEvent(ArticleModel article) {
        this.article = article;
    }

    public ArticleModel getArticle() {
        return article;
    }

    @Override
    public Type<EditArticleEventHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(EditArticleEventHandler handler) {
        handler.onEditArticle(this);
    }
}
